var ApgarAssistant = Class.create(AbstractModule, {

setupWidgets: function() {


		//About
		this.controller.setupWidget(Mojo.Menu.appMenu, {
			omitDefaultItems: true
		}, {
			visible: true,
			items: [
      		Mojo.Menu.editItem,
			{ label: "Disclaimer", command: "do-disclaimer" },					
				{ label: "License", command: "do-license" },
				{ label: "Help", command: "do-help" }
			]
		});

	this.controller.setupWidget("activity", {
			label: "Activity/Tone",
			choices: [
				{ label: "Active", value: 2},
				{ label: "Some Extremity Flexion", value: 1},
				{ label: "Limp", value: 0}
			]
		}, this.activityModel = {
			value: 2
		});
		
		
	this.controller.setupWidget("pulse", {
			label: "Pulse",
			choices: [
				{ label: "> 100 bpm", value: 2},
				{ label: "< 100 bpm", value: 1},
				{ label: "Absent", value: 0}
			]
		}, this.pulseModel = {
			value: 2
		});
		
	this.controller.setupWidget("grimace", {
			label: "Grimace",
			choices: [
				{ label: "Sneeze/Cough", value: 2},
				{ label: "Grimace", value: 1},
				{ label: "None", value: 0}
			]
		}, this.grimaceModel = {
			value: 2
		});
		
		this.controller.setupWidget("color", {
			label: "color",
			choices: [
				{ label: "All Pink", value: 2},
				{ label: "Blue Extremities, Pink Body", value: 1},
				{ label: "Blue/Pale", value: 0}
			]
		}, this.colorModel = {
			value: 2
		});	
		
		
		this.controller.setupWidget("breathing", {
			label: "breathing",
			choices: [
				{ label: "Good/Crying", value: 2},
				{ label: "Irregular/Slow", value: 1},
				{ label: "Absent", value: 0}
			]
		}, this.breathingModel = {
			value: 2
		});	
		
},



	calculate: function() {
	var result = apgarcalc(parseInt(this.activityModel.value),parseInt(this.pulseModel.value),parseInt(this.grimaceModel.value),parseInt(this.colorModel.value),parseInt(this.breathingModel.value));
	
	return "The score is " + result.score +"<br />This is considered "+result.interp;
	}
});

